/*
 * Copyright (c) 2005, 2014 vacoor
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.vacoor.nothing.security.logging.log4j;

import org.apache.log4j.Logger;
import org.vacoor.nothing.security.logging.LoggerInfo;

public class Log4jInfo extends LoggerInfo {
    final Logger logger;

    public Log4jInfo(String name, Logger logger) {
        super(name);
        this.logger = logger;
    }

    public String getLevel() {
        if (this.logger == null) {
            return null;
        }
        Object level = this.logger.getLevel();
        if (level == null) {
            return null;
        }
        return level.toString();
    }

    public String getName() {
        return this.name;
    }

    public boolean isSet() {
        return (this.logger != null) && (this.logger.getLevel() != null);
    }
}